
import request from './request'

interface LoginData{
    token:string,
    tokenHead:string
}
interface LoginParams{
    password:string,
    username:string
}

interface adminTnfoData{
    icon?:null,
    menus:unknown[],
    roles:string[],
    username:string
}

interface LoginsponseData<T = null>{
    code:number,
    message:string,
    data?:T |null
}
//登录接口
export const adminLogin=(data:LoginParams):Promise<LoginsponseData<LoginData>>=>request.post('/admin/login',data)

//获取当前用户信息
export const adminTnfo = ():Promise<LoginsponseData<adminTnfoData>>=>request.get('/admin/info')